<?php if (!defined('SERVER_ROOT')) exit('No direct script access allowed');

class loaibckh_Controller extends Controller {

    function __construct()
    {
        parent::__construct('qlcb', 'loaibckh');
        $this->check_login();
        $this->view->template->menu_html =$this->CREATE_MENU();
        $this->view->template->nhacviec_html =$this->CREATE_NHAC_VIEC(); 
        $this->CHECK_QUYEN('qlcb', 'loaibckh');
    }

    function main(){
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $this->dsp_all_loaibckh();
    }

    function dsp_all_loaibckh(){
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $VIEW_DATA['arr_all_loaibckh']= $this->model->qry_all_loaibckh();
        $this->view->render('dsp_all_loaibckh', $VIEW_DATA);
    }
    public function dsp_single_loaibckh($MA_LOAI_BCKH){
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $MA_LOAI_BCKH = replace_bad_char($MA_LOAI_BCKH);
        $VIEW_DATA['arr_single_loaibckh'] = $this->model->qry_single_loaibckh($MA_LOAI_BCKH);
        $this->view->render('dsp_single_loaibckh', $VIEW_DATA);
    }
    public function update_loaibckh()
    {
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $this->model->goback_url = $this->view->get_controller_url() . 'dsp_all_loaibckh';
        $this->model->update_loaibckh();
    }
    public function delete_loaibckh(){
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $this->model->goback_url = $this->view->get_controller_url() . 'dsp_all_loaibckh';
        $this->model->delete_loaibckh();
    }
}